class MembersCache < ActiveRecord::Migration
  def self.up
    add_column :members, :stored_service_hours, :float, :default => 0
    add_column :members, :stored_fellowships, :integer, :default => 0
    add_column :members, :stored_leaderships, :integer, :default => 0
    add_column :members, :stored_fundraisers, :integer, :default => 0
    add_column :members, :stored_office_hours, :float, :default => 0
    add_column :members, :stored_ceremonies, :integer, :default => 0
    add_column :members, :stored_dues, :integer, :default => 0
    add_column :members, :stored_active_meetings, :integer, :default => 0
    add_column :members, :stored_pledge_meetings, :integer, :default => 0
    add_column :members, :stored_committees, :integer, :default => 0
    add_column :members, :stored_pledge_reqs, :integer, :default => 0
    add_column :members, :stored_flex_points, :float, :default => 0
    
    add_column :members, :up_to_date, :boolean, :default => false
    
    #add_index :members, :id
    #add_index :events, :id
    #add_index :attendance_records, :event_id
    
  end

  def self.down
    remove_column :members, :stored_service_hours
    remove_column :members, :stored_fellowships
    remove_column :members, :stored_leaderships
    remove_column :members, :stored_fundraisers
    remove_column :members, :stored_office_hours
    remove_column :members, :stored_ceremonies
    remove_column :members, :stored_dues
    remove_column :members, :stored_active_meetings
    remove_column :members, :stored_pledge_meetings
    remove_column :members, :stored_committees
    remove_column :members, :stored_pledge_reqs
    remove_column :members, :stored_flex_points
    
    remove_column :members, :up_to_date
    
    #remove_index :members, :id
    #remove_index :events, :id
    #remove_index :attendance_records, :event_id
    
  end
end
